package com.greenlife.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.greenlife.model.User;
import com.greenlife.service.UserService;

@Controller
public class UserController {
	@Autowired
	private UserService userService;

	@RequestMapping(value = "/login.do")
	public String userLogin() {
		return "testDemo";
	}

	@RequestMapping(value = "/user.do", method = RequestMethod.GET)
	@ResponseBody
	public User selectUser(User user) {
		System.out.println(user.getId());
		User result = userService.selectUser(user);
		return result;
	}
}
